package com.hx.er.common.logic;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;

public class SessionUtil {
	public static void setAttributes(ActionContext context, Map<String, Object> attributes) {
		Map<String, Object> attributeMap = context.getSession();
		attributeMap.putAll(attributes);
	}
	
	public static void setAttributes(ActionContext context, String key, Object value) {
		Map<String, Object> attributeMap = context.getSession();
		attributeMap.put(key, value);
	}

	public static void clearAttributes(ActionContext context) {
		Map<String, Object> attributeMap = context.getSession();
		attributeMap.clear();
	}
	
	public static void removeAttribute(ActionContext context, String key) {
		Map<String, Object> attributeMap = context.getSession();
		attributeMap.put(key, null);
	}
}
